xen/arm: p2m: Find the memory attributes based on the p2m type
authorJulien Grall <julien.grall@arm.com>
Thu, 28 Jul 2016 14:20:09 +0000 (15:20 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 29 Jul 2016 00:41:43 +0000 (17:41 -0700)
commit4b39f258f3a369c7882b033dd105cc6d8e3b707e
treef7f5a5d52d28a0fc9de5ceffd5500510e86681c0
parent0cef6b81f97010a13bbd7437b036619cecd56f1f
xen/arm: p2m: Find the memory attributes based on the p2m type

Currently, mfn_to_p2m_entry is relying on the caller to provide the
correct memory attribute and will deduce the sharability based on it.

Some of the callers, such as p2m_create_table, are using same memory
attribute regardless the underlying p2m type. For instance, this will
lead to use change the memory attribute from MATTR_DEV to MATTR_MEM when
a MMIO superpage is shattered.

Furthermore, it makes more difficult to support different shareability
with the same memory attribute.

All the memory attributes could be deduced via the p2m type. This will
simplify the code by dropping one parameter.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c